summaryrefslogtreecommitdiffstats
path: root/src/core/hle/kernel/k_memory_layout.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/hle/kernel/k_memory_layout.cpp')
-rw-r--r--src/core/hle/kernel/k_memory_layout.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/core/hle/kernel/k_memory_layout.cpp b/src/core/hle/kernel/k_memory_layout.cpp
index 9ff751119..af40092c0 100644
--- a/src/core/hle/kernel/k_memory_layout.cpp
+++ b/src/core/hle/kernel/k_memory_layout.cpp
@@ -85,7 +85,8 @@ bool KMemoryRegionTree::Insert(u64 address, size_t size, u32 type_id, u32 new_at
return true;
}
-VAddr KMemoryRegionTree::GetRandomAlignedRegion(size_t size, size_t alignment, u32 type_id) {
+KVirtualAddress KMemoryRegionTree::GetRandomAlignedRegion(size_t size, size_t alignment,
+ u32 type_id) {
// We want to find the total extents of the type id.
const auto extents = this->GetDerivedRegionExtents(static_cast<KMemoryRegionType>(type_id));
@@ -130,11 +131,13 @@ KMemoryLayout::KMemoryLayout()
m_virtual_linear_tree{m_memory_region_allocator}, m_physical_linear_tree{
m_memory_region_allocator} {}
-void KMemoryLayout::InitializeLinearMemoryRegionTrees(PAddr aligned_linear_phys_start,
- VAddr linear_virtual_start) {
+void KMemoryLayout::InitializeLinearMemoryRegionTrees(KPhysicalAddress aligned_linear_phys_start,
+ KVirtualAddress linear_virtual_start) {
// Set static differences.
- m_linear_phys_to_virt_diff = linear_virtual_start - aligned_linear_phys_start;
- m_linear_virt_to_phys_diff = aligned_linear_phys_start - linear_virtual_start;
+ m_linear_phys_to_virt_diff =
+ GetInteger(linear_virtual_start) - GetInteger(aligned_linear_phys_start);
+ m_linear_virt_to_phys_diff =
+ GetInteger(aligned_linear_phys_start) - GetInteger(linear_virtual_start);
// Initialize linear trees.
for (auto& region : GetPhysicalMemoryRegionTree()) {